<template>
	<view>
		<an-nav-bar title="每日特价"> </an-nav-bar>
		<view class="coupons">
			<view class="inner flex">
				<view class="list flex">
					<view class="item" v-for="(item,index) in 3" :key="index">
						<view class="price">
							<span class="span1">￥</span>
							<span class="span2">30</span>
						</view>
						<view class="name">鹤亭休闲会所</view>
					</view>
				</view>
				<view class="right flex">
					<view class="btn flex_center">
						<view class="uni-label-pointer">领券中心</view>
					</view>
					<view class="double-arrow"></view>
				</view>
			</view>
		</view>
		<view class="tabbar_top">
			<view class="param_search">
				<view class="param_item flex" @click="sortFilter = !sortFilter">
					<text class="text">综合排序</text>
					<text class="iconfont icon-caret-down"></text>
					<view class="filter-box" :class="{'active-filter-box':sortFilter}"
						@touchmove.stop.prevent="moveHandle">
						<view class="filter-cnt">
							<view class="" @click.stop="sortFilter = false">综合排序</view>
							<view class="" @click.stop="sortFilter = false">订单最多</view>
							<view class="" @click.stop="sortFilter = false">距离最近</view>
							<view class="" @click.stop="sortFilter = false">最近加入</view>
							<view class="" @click.stop="sortFilter = false">评分最高</view>
						</view>
					</view>
				</view>
				<view class="param_item flex" @click="serviceFilter = !serviceFilter">
					<text class="text">服务商</text>
					<text class="iconfont icon-caret-down"></text>
					<view class="filter-box" :class="{'active-filter-box':serviceFilter}"
						@touchmove.stop.prevent="moveHandle">
						<view class="service-cnt">
							<scroll-view class="scroll-view" scroll-y="true">
								<view class="scroll-view-item " :class="{'item-check':index < 3}"
									v-for="(item,index) in 50" :key="index">家人到家</view>
							</scroll-view>
							<view class="btn flex">
								<view class="" @click.stop="serviceFilter = false">重置</view>
								<view class="" @click.stop="serviceFilter = false">确认</view>
							</view>
						</view>
					</view>
				</view>
				<view class="screen flex_center " @click="whereFilter = !whereFilter">
					<text>筛选</text>
					<text class="iconfont icon-shaixuan"></text>
					<view class="filter-box" :class="{'active-filter-box':whereFilter}"
						@touchmove.stop.prevent="moveHandle">
						<view class="where-cnt"></view>
					</view>
				</view>
			</view>
		</view>
		<view class="pageContent">
			<view class="products">
				<view class="item flex" v-for="(item,index) in 10" :key="index">
					<image class="image" src="/upload/20210817/202108171001362673.jpeg" mode="">
					</image>
					<view class="right">
						<view class="name">润颜·头道汤头疗</view>
						<view class="store">润颜养生馆（宇宏花园店）</view>
						<view class="time">60分钟</view>
						<view class="price flex">
							<view class="uni-label-pointer">
								<span>58</span>元
							</view>
							<view class="original-price">198元</view>
							<view class="vertical-decrement">立减140元</view>
						</view>
					</view>
					<view class="address flex">12km</view>
					<button class="btn">立即抢购</button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isSearch: false,
				sortFilter: false,
				serviceFilter: false,
				whereFilter: false,
			};
		},
		methods: {
			onSearch() {
				this.isSearch = !this.isSearch
			},
			moveHandle() {
				return true
			}
		}
	}
</script>

<style lang="scss" scoped>
	.pageContent {
		min-height: calc(100vh - 322px);

		.products {
			padding: 10rpx 0;

			.item {
				position: relative;
				padding: 30rpx;
				background: #fff;
				margin-bottom: 10rpx;

				.image {
					width: 160rpx;
					height: 160rpx;
					border-radius: 10rpx;
					margin-right: 20rpx;
				}

				.right {
					.name {
						color: #444;
						font-size: 14px;
					}

					.store {
						color: #666;
						font-size: 13px;
					}

					.time {
						color: #666;
						font-size: 12px;
					}

					.price {
						.uni-label-pointer {
							color: #e02020;
							font-size: 22rpx;
							font-weight: 700;
							margin-right: 10rpx;

							span {
								font-size: 34rpx;
							}
						}

						.original-price {
							color: #999;
							font-size: 22rpx;
							text-decoration: line-through;
							margin-right: 20rpx;
						}

						.vertical-decrement {
							width: 144rpx;
							height: 36rpx;
							background: linear-gradient(1turn, rgba(255, 98, 81, .2), rgba(255, 171, 127, .2));
							border-radius: 10rpx;
							color: #f94c02;
							font-size: 22rpx;
							text-align: center;
							line-height: 36rpx;
						}
					}

				}

				.address {
					position: absolute;
					right: 32rpx;
					top: 30rpx;
					color: #666;
					font-size: 24rpx;

					&::before {
						content: "";
						width: 22rpx;
						height: 26rpx;
						background: url(/static/weizhi.png) no-repeat;
						background-size: 100% auto;
						margin-right: 6rpx;
					}
				}

				.btn {
					width: 160rpx;
					height: 60rpx;
					line-height: 60rpx;
					text-align: center;
					background: linear-gradient(270deg, #ff8022, #f11f1f);
					border-radius: 32rpx;
					position: absolute;
					right: 20rpx;
					top: 100rpx;
					color: #fff;
					font-size: 26rpx;

					&::after {
						content: " ";
						width: 200%;
						height: 200%;
						position: absolute;
						top: 0;
						left: 0;
						border: 1px solid rgba(0, 0, 0, .2);
						-webkit-transform: scale(.5);
						transform: scale(.5);
						-webkit-transform-origin: 0 0;
						transform-origin: 0 0;
						box-sizing: border-box;
						border-radius: 10px;
					}
				}
			}
		}
	}

	.tabbar_top {
		width: 100%;
		height: 80rpx;
		background: #fff;
		box-shadow: 0 1px 4px 0 rgba(0, 0, 0, .06);
		// position: fixed;
		box-sizing: border-box;
		// left: 0;
		// top: 88rpx;
		z-index: 9999;

		.param_search {
			font-size: 26rpx;
			font-weight: 400;
			color: #666;
			display: flex;
			align-items: center;
			height: 78rpx;
			justify-content: space-between;
			position: relative;

			.param_item {
				flex: 1;
				height: 80rpx;
				color: #666;
				font-size: 26rpx;

				.text {
					display: block;
					max-width: 130rpx;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
					margin-left: 30rpx;
				}

				.icon-caret-down {
					font-size: 28rpx;
					color: #ccc;
				}
			}

			.screen {
				width: 150rpx;
				color: #666;
				font-size: 26rpx;
				position: relative;
				height: 80rpx;

				&::before {
					display: block;
					content: "";
					width: 2rpx;
					height: 24rpx;
					background: #d8d8d8;
					border-radius: 2rpx;
					position: absolute;
					left: 0;
					top: 50%;
					-webkit-transform: translateY(-50%);
					transform: translateY(-50%);
				}
			}

			.filter-box {
				width: 100vw;
				height: 0px;
				overflow: hidden;
				top: 80rpx;
				right: 0;
				background-color: rgba(#333, .4);
				position: absolute;
				z-index: 9;
				transition: all .5s;

				.where-cnt {
					margin-left: 20%;
					width: 80%;
					height: 100%;
					background-color: #fff;
				}

				.service-cnt {
					width: 100%;
					height: 50vh;
					background-color: #ffffff;
					box-sizing: border-box;
					padding: 10px 0 0;

					.btn {
						width: 100%;
						height: 88rpx;
						border-top: 2rpx solid #eee;

						>view {
							flex: 1;
							text-align: center;
							line-height: 88rpx;
							height: 88rpx;
							font-size: 24rpx;

							&:last-child {
								background-color: #f308fe;
								color: #fff;
							}
						}
					}

					.scroll-view {
						width: 100%;
						height: calc(50vh - 108rpx);
						flex-wrap: wrap;
						text-align: left;
						padding: 0 20rpx;
						box-sizing: border-box;

						.scroll-view-item {
							display: inline-block;
							width: calc(33.3% - 16rpx);
							height: 50rpx;
							line-height: 50rpx;
							background: #f8f8f8 url(/static/icon_store_chk.png) no-repeat 20rpx 50%;
							background-size: 36rpx auto;
							margin-right: 19rpx;
							padding-left: 34px;
							color: #666;
							font-size: 24rpx;
							box-sizing: border-box;
							overflow: hidden;
							border-radius: 6rpx;

							&:nth-child(3n + 3) {
								margin-right: 0rpx;
							}
						}

						.item-check {
							background: #fdebfe url(/static/icon_store_chked.png) no-repeat 20rpx 50%;
							background-size: 36rpx auto;
							color: #f308fe;
						}
					}
				}

				.filter-cnt {
					width: 100%;
					background-color: #fff;

					>view {
						text-align: left;
						width: 100%;
						height: 80rpx;
						line-height: 80rpx;
						color: #666;
						font-size: 24rpx;
						overflow: hidden;
						position: relative;
						box-sizing: border-box;
						padding: 0 30rpx;
						border-bottom: 2rpx solid #f8f8f8;
					}
				}
			}

			.active-filter-box {
				height: calc(100vh - 160rpx) !important;
			}
		}
	}

	.coupons {
		padding: 20rpx;
		background: #fff;
		margin-bottom: 10rpx;

		.inner {
			width: 710rpx;
			height: 190rpx;
			background: url(/static/couponsBack1.png) no-repeat;
			background-size: 100% auto;
			border-radius: 12rpx;
			box-sizing: border-box;
			padding: 0 14rpx 0 10rpx;

			.right {
				flex: 1;
				justify-content: flex-end;


				.btn {
					width: 120rpx;
					height: 120rpx;
					background: #e45442;
					box-shadow: 0 2rpx 2rpx 0 #cb2f1d, 0 1rpx 6rpx 0 rgba(191, 5, 5, .5);
					border-radius: 50%;
					border: 4rpx solid #cb2f1d;
					box-sizing: border-box;
					color: #fff;
					text-align: center;
					font-size: 28rpx;
					font-weight: 700;

					.uni-label-pointer {
						padding: 0 20rpx;
						letter-spacing: 4rpx;
					}


				}

				.double-arrow {
					width: 28rpx;
					height: 40rpx;
					background: url(/static/double-arrow.png) no-repeat;
					background-size: 100% auto;
					margin-left: 12rpx;
				}
			}

			.list {
				width: 540rpx;
				height: 170rpx;
				box-sizing: border-box;
				padding: 0 20rpx;

				.item {
					width: 138rpx;
					height: 130rpx;
					background: url(/static/couponBack2.png) no-repeat;
					background-size: 100% auto;
					margin-right: 18rpx;

					.name {
						color: #fff;
						font-size: 20rpx;
						text-align: center;
						padding: 0 10rpx;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
					}

					.price {
						color: #e02020;
						font-size: 22rpx;
						text-align: center;
						padding: 20rpx 0;
						font-weight: 700;

						.span2 {
							font-size: 40rpx;
						}
					}

					&:last-child {
						margin-right: 0rpx;
					}
				}
			}
		}
	}
</style>
